package com.accgm.api.common;

public class ErrorCode2 {
    public final static ErrorCode2 UNKNOWN = new ErrorCode2(0, "unknown");
    public final static ErrorCode2 USER_OR_PWD_ERROR = new ErrorCode2(1,
	    "User or password error!");
    public final static ErrorCode2 URL_NOT_FOUND = new ErrorCode2(2,
	    "URL not found!");
    public final static ErrorCode2 EMAIL_FORMAT_ERROR = new ErrorCode2(3,
	    "Email format error!");
    // oauth
    public final static ErrorCode2 OAUTH_UNKOWN_APP = new ErrorCode2(53,
	    "OAuth – unknown application");
    
    public final static ErrorCode2 OAUTH_UNKOWN_BLOGNAME = new ErrorCode2(54,
    "OAuth – unknown blogname");
    
    public final static ErrorCode2 OAUTH_UNKOWN_LOGININFO = new ErrorCode2(55,
    "OAuth – unknown user or password");
    
    
    public final static ErrorCode2 RRGISTER_DIGU_ERROR = new ErrorCode2(56,
    "OAuth – register digu eroor");
    public final static ErrorCode2 RRGISTER_BIND_ERROR = new ErrorCode2(57,
    "OAuth – bind error");
    
    public final static ErrorCode2 OAUTH_UNKOWN_BLOG_ACCESS_TOKEN = new ErrorCode2(58,
    "OAuth – unknown blog_access_token");
    
    public final static ErrorCode2 OAUTH_UNKOWN_BLOG_ACCESS_TOKEN_SECRET = new ErrorCode2(59,
    "OAuth – unknown blog_access_secret");
    
    public final static ErrorCode2 OAUTH_UNKOWN_BLOG_REDRESH_TOKEN = new ErrorCode2(60,
    "OAuth – unknown blog_refresh_token");
    
    public final static ErrorCode2 OAUTH_UNKOWN_BLOG_EXPIRES_IN = new ErrorCode2(61,
    "OAuth – unknown expires_in");
    
    public final static ErrorCode2 ACCESS_TOKEN_ERROR = new ErrorCode2(62,
    "ACCESS_TOKEN  error!");
    
    public final static ErrorCode2 SOURCE_PIC_ID_ERROR = new ErrorCode2(63,
    "sourcePicId  error!");
    
    public final static ErrorCode2 NICKNAME_ERROR = new ErrorCode2(64,
    "nickname  empty!");
    
    public final static ErrorCode2 NICKNAME_OAUTH_ERROR = new ErrorCode2(65,
    "nickname  must be a-z A-Z 中文 _");
    
    public final static ErrorCode2 PICKEY_OAUTH_ERROR = new ErrorCode2(65,
    "picKey  not be null");
    
    public final static ErrorCode2 XY_ERROR = new ErrorCode2(66,
    "xy值无效");
    
    public final static ErrorCode2 USERINFO_ERROR = new ErrorCode2(67,
    	    "userInfo is Empty");
    
    private int errorCode;
    private String errorDescription;

    private ErrorCode2(int code, String desc) {
	this.errorCode = code;
	this.errorDescription = desc;
    }

    public int getErrorCode() {
	return errorCode;
    }

    public String getErrorDescription() {
	return errorDescription;
    }

    public boolean equals(Object obj) {
	if (obj == null)
	    return false;
	if (obj instanceof ErrorCode2) {
	    ErrorCode2 ec = (ErrorCode2) obj;
	    if (ec.errorCode == this.errorCode
		    && ec.errorDescription.equals(this.errorDescription)) {
		return true;
	    }
	}
	return false;
    }

}
